
Require("CommonScript/AutoChess/Buffer.lua")
local SetIndex = Lib.SetIndex
local WriteBuffer= Lib.WriteBuffer

local SkillOrder = {}
Lib.Protos.SkillOrder = SkillOrder

function SkillOrder:Parse(buffer)
	while true do
		local tag, ty = buffer:ReadTagAndType()
		if tag == 0 then
			return

		elseif tag == 1 then
			if self.Position == nil then
				self.Position = {}
			end
			
			local temp = buffer:ReadInt()

			table.insert(self.Position, temp)

		else
			buffer:DefaultRead(tag, ty)
		end
	end
end

function SkillOrder:Serialize(shareBuff)
	local buf = {}
	SetIndex(buf, WriteBuffer)
	buf:Init(shareBuff)

	
	if self.Position ~= nil then
		for k, v in ipairs(self.Position) do
			
			buf:WriteInt(1, v)

		end
	end

	return buf
end

SkillOrder.DefaultV = {
Position = {},

}
function SkillOrder:SetDefault()
	Lib:DefaultInitTb(self, SkillOrder.DefaultV)
end

Require("CommonScript/AutoChess/Buffer.lua")
local SetIndex = Lib.SetIndex
local WriteBuffer= Lib.WriteBuffer

local JumpOrder = {}
Lib.Protos.JumpOrder = JumpOrder

function JumpOrder:Parse(buffer)
	while true do
		local tag, ty = buffer:ReadTagAndType()
		if tag == 0 then
			return

		elseif tag == 1 then
			if self.tarPos == nil then
				self.tarPos = {}
			end
			
			local temp = buffer:ReadInt()

			table.insert(self.tarPos, temp)

		elseif tag == 2 then
			if self.startPos == nil then
				self.startPos = {}
			end
			
			local temp = buffer:ReadInt()

			table.insert(self.startPos, temp)

		else
			buffer:DefaultRead(tag, ty)
		end
	end
end

function JumpOrder:Serialize(shareBuff)
	local buf = {}
	SetIndex(buf, WriteBuffer)
	buf:Init(shareBuff)

	
	if self.tarPos ~= nil then
		for k, v in ipairs(self.tarPos) do
			
			buf:WriteInt(1, v)

		end
	end

	if self.startPos ~= nil then
		for k, v in ipairs(self.startPos) do
			
			buf:WriteInt(2, v)

		end
	end

	return buf
end

JumpOrder.DefaultV = {
tarPos = {},
startPos = {},

}
function JumpOrder:SetDefault()
	Lib:DefaultInitTb(self, JumpOrder.DefaultV)
end

Require("CommonScript/AutoChess/Buffer.lua")
local SetIndex = Lib.SetIndex
local WriteBuffer= Lib.WriteBuffer

local NpcDeltaState = {}
Lib.Protos.NpcDeltaState = NpcDeltaState

function NpcDeltaState:Parse(buffer)
	while true do
		local tag, ty = buffer:ReadTagAndType()
		if tag == 0 then
			return

		elseif tag == 1 then
			self.bBeginBattle = buffer:ReadBool()

		elseif tag == 3 then
			self.nMana = buffer:ReadInt()

		elseif tag == 5 then
			if self.gridPos == nil then
				self.gridPos = {}
			end
			
			local temp = buffer:ReadInt()

			table.insert(self.gridPos, temp)

		elseif tag == 6 then
			self.isDummy = buffer:ReadBool()

		elseif tag == 7 then
			self.nPos = buffer:ReadInt()

		elseif tag == 8 then
			self.nPlayerId = buffer:ReadUnSignedInt()

		elseif tag == 9 then
			self.nHanderIdx = buffer:ReadInt()

		elseif tag == 11 then
			self.extraData = buffer:ReadString()

		elseif tag == 12 then
			self.nItemTemplateId = buffer:ReadInt()

		elseif tag == 13 then
			if self.tbJumpTarget == nil then
				self.tbJumpTarget = {}
			end
			
			local temp = buffer:ReadInt()

			table.insert(self.tbJumpTarget, temp)

		elseif tag == 14 then
			self.keepAct = buffer:ReadBool()

		elseif tag == 15 then
			self.nReplaceAttackDist = buffer:ReadInt()

		elseif tag == 27 then
			self.nReplaceAttackSkill = buffer:ReadInt()

		elseif tag == 28 then
			self.nSkillId = buffer:ReadInt()

		elseif tag == 29 then
			local msgObj = {}
			SetIndex(msgObj, SkillOrder)
			self.channelOrder = buffer:ReadMsg(msgObj)

		elseif tag == 30 then
			local msgObj = {}
			SetIndex(msgObj, JumpOrder)
			self.jumpOrder = buffer:ReadMsg(msgObj)

		elseif tag == 31 then
			self.nXuanZhengSkill = buffer:ReadInt()

		elseif tag == 32 then
			self.nOriginPlayerId = buffer:ReadUnSignedInt()

		elseif tag == 33 then
			self.nBigSkillId = buffer:ReadInt()

		elseif tag == 34 then
			self.bFinishBattle = buffer:ReadBool()

		elseif tag == 35 then
			self.bHuanXiang = buffer:ReadBool()

		elseif tag == 36 then
			if self.tbDragTarget == nil then
				self.tbDragTarget = {}
			end
			
			local temp = buffer:ReadInt()

			table.insert(self.tbDragTarget, temp)

		elseif tag == 37 then
			self.hideBlood = buffer:ReadBool()

		elseif tag == 38 then
			self.GuZhiLanSkillId = buffer:ReadInt()

		elseif tag == 39 then
			self.FeatureResId = buffer:ReadInt()

		elseif tag == 40 then
			self.NeedRefresh = buffer:ReadBool()

		elseif tag == 41 then
			self.ShowAdd = buffer:ReadBool()

		elseif tag == 42 then
			self.PlasmaId = buffer:ReadInt()

		elseif tag == 43 then
			if self.ThrowTarget == nil then
				self.ThrowTarget = {}
			end
			
			local temp = buffer:ReadInt()

			table.insert(self.ThrowTarget, temp)

		elseif tag == 44 then
			self.ShowRemove = buffer:ReadBool()

		elseif tag == 45 then
			self.jiSkillId = buffer:ReadInt()

		elseif tag == 46 then
			self.moveSpeed = buffer:ReadInt()

		elseif tag == 47 then
			self.shadowNpc = buffer:ReadBool()

		else
			buffer:DefaultRead(tag, ty)
		end
	end
end

function NpcDeltaState:Serialize(shareBuff)
	local buf = {}
	SetIndex(buf, WriteBuffer)
	buf:Init(shareBuff)

	
	if self.bBeginBattle ~= nil then
		buf:WriteBool(1, self.bBeginBattle)
	end

	if self.nMana ~= nil then
		buf:WriteInt(3, self.nMana)
	end

	if self.gridPos ~= nil then
		for k, v in ipairs(self.gridPos) do
			
			buf:WriteInt(5, v)

		end
	end

	if self.isDummy ~= nil then
		buf:WriteBool(6, self.isDummy)
	end

	if self.nPos ~= nil then
		buf:WriteInt(7, self.nPos)
	end

	if self.nPlayerId ~= nil then
		buf:WriteUnSignedInt(8, self.nPlayerId)
	end

	if self.nHanderIdx ~= nil then
		buf:WriteInt(9, self.nHanderIdx)
	end

	if self.extraData ~= nil then
		buf:WriteString(11, self.extraData)
	end

	if self.nItemTemplateId ~= nil then
		buf:WriteInt(12, self.nItemTemplateId)
	end

	if self.tbJumpTarget ~= nil then
		for k, v in ipairs(self.tbJumpTarget) do
			
			buf:WriteInt(13, v)

		end
	end

	if self.keepAct ~= nil then
		buf:WriteBool(14, self.keepAct)
	end

	if self.nReplaceAttackDist ~= nil then
		buf:WriteInt(15, self.nReplaceAttackDist)
	end

	if self.nReplaceAttackSkill ~= nil then
		buf:WriteInt(27, self.nReplaceAttackSkill)
	end

	if self.nSkillId ~= nil then
		buf:WriteInt(28, self.nSkillId)
	end

	if self.channelOrder ~= nil then
		SetIndex(self.channelOrder, SkillOrder)
		buf:WriteMsg(29, self.channelOrder)
	end

	if self.jumpOrder ~= nil then
		SetIndex(self.jumpOrder, JumpOrder)
		buf:WriteMsg(30, self.jumpOrder)
	end

	if self.nXuanZhengSkill ~= nil then
		buf:WriteInt(31, self.nXuanZhengSkill)
	end

	if self.nOriginPlayerId ~= nil then
		buf:WriteUnSignedInt(32, self.nOriginPlayerId)
	end

	if self.nBigSkillId ~= nil then
		buf:WriteInt(33, self.nBigSkillId)
	end

	if self.bFinishBattle ~= nil then
		buf:WriteBool(34, self.bFinishBattle)
	end

	if self.bHuanXiang ~= nil then
		buf:WriteBool(35, self.bHuanXiang)
	end

	if self.tbDragTarget ~= nil then
		for k, v in ipairs(self.tbDragTarget) do
			
			buf:WriteInt(36, v)

		end
	end

	if self.hideBlood ~= nil then
		buf:WriteBool(37, self.hideBlood)
	end

	if self.GuZhiLanSkillId ~= nil then
		buf:WriteInt(38, self.GuZhiLanSkillId)
	end

	if self.FeatureResId ~= nil then
		buf:WriteInt(39, self.FeatureResId)
	end

	if self.NeedRefresh ~= nil then
		buf:WriteBool(40, self.NeedRefresh)
	end

	if self.ShowAdd ~= nil then
		buf:WriteBool(41, self.ShowAdd)
	end

	if self.PlasmaId ~= nil then
		buf:WriteInt(42, self.PlasmaId)
	end

	if self.ThrowTarget ~= nil then
		for k, v in ipairs(self.ThrowTarget) do
			
			buf:WriteInt(43, v)

		end
	end

	if self.ShowRemove ~= nil then
		buf:WriteBool(44, self.ShowRemove)
	end

	if self.jiSkillId ~= nil then
		buf:WriteInt(45, self.jiSkillId)
	end

	if self.moveSpeed ~= nil then
		buf:WriteInt(46, self.moveSpeed)
	end

	if self.shadowNpc ~= nil then
		buf:WriteBool(47, self.shadowNpc)
	end

	return buf
end

NpcDeltaState.DefaultV = {
bBeginBattle = false,
nMana = 0,
gridPos = {},
isDummy = false,
nPos = 0,
nPlayerId = 0,
nHanderIdx = 0,
extraData = "",
nItemTemplateId = 0,
tbJumpTarget = {},
keepAct = false,
nReplaceAttackDist = 0,
nReplaceAttackSkill = 0,
nSkillId = 0,
nXuanZhengSkill = 0,
nOriginPlayerId = 0,
nBigSkillId = 0,
bFinishBattle = false,
bHuanXiang = false,
tbDragTarget = {},
hideBlood = false,
GuZhiLanSkillId = 0,
FeatureResId = 0,
NeedRefresh = false,
ShowAdd = false,
PlasmaId = 0,
ThrowTarget = {},
ShowRemove = false,
jiSkillId = 0,
moveSpeed = 0,
shadowNpc = false,

}
function NpcDeltaState:SetDefault()
	Lib:DefaultInitTb(self, NpcDeltaState.DefaultV)
end

